from  MyClasses.MyConfigParser import MyConfigParser

from StringIO import StringIO

from unittest import TestCase
from mock import patch, Mock

class MyConfigParserTest(TestCase):



	def setUp(self):
		tree = StringIO("""
					<document>
						<host>localhost</host>
						<port>993</port>
						<ssl>1</ssl>
						<user>username</user>
						<pass>password</pass>
					</document>
""")

		self.config_parser = MyConfigParser(tree)

	def get_host_test(self):
		self.assertEquals(self.config_parser.getHost(), 'localhost')

	def get_port_test(self):
		self.assertEquals(self.config_parser.getPort(), '993')

	def get_ssl_test(self):
		self.assertEquals(self.config_parser.getSSL(), '1')

	def get_user_test(self):
		self.assertEquals(self.config_parser.getUser(), 'username')

	def get_pass_test(self):
		self.assertEquals(self.config_parser.getPass(), 'password')
if __name__ == "__main__":
	unittest.main()